home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / newsgrp / group93c.txt / 000041_icon-group-sender _Mon Sep 6 12:57:15 1993.msg < prev    next >
Internet Message Format  |  1994-02-02  |  1KB

  1. Received: from owl.CS.Arizona.EDU by cheltenham.cs.arizona.edu; Mon, 6 Sep 1993 12:57:15 MST
  2. Received: by owl.cs.arizona.edu; Mon, 6 Sep 1993 12:57:13 MST
  3. Via: uk.ac.edinburgh.festival; Mon, 6 Sep 1993 08:28:53 +0100
  4. Date: 06 Sep 93 08:28:46 BST
  5. From: R J Hare <rjhare@festival.ed.ac.uk>
  6. Subject: returning results from procedure
  7. To: icon-group@cs.arizona.edu
  8. Reply-To: r.j.hare@edinburgh.ac.uk
  9. Organisation: Edinburgh University Computing Service
  10. Message-Id: <9309060828.aa21320@uk.ac.ed.festival>
  11. Status: R
  12. Errors-To: icon-group-errors@cs.arizona.edu
  13.  
  14. I've been using Icon for seberal years now, but recently I stumbled across a
  15. 'problem' for the fist time - I wanted to return more than one result from a
  16. procedure (yup - strange to relate, after several years I had never needed to
  17. do this before).
  18.  
  19. What I want to know is "what is the 'best' way to return several results from
  20. a procedure?'. One obvious way to do it is to use a list:
  21.  
  22. procedure myproc
  23.   .
  24. list_of_results:=[]
  25.   .
  26.   .
  27. list_of_results[1]:=...
  28. list_of_results[2]:=...
  29.   .
  30.   .
  31. return list_of_results
  32. end
  33.  
  34. but I guess that one could use a record.
  35.  
  36. Any thoughts on which is best?
  37.  
  38. Thanks.
  39.  
  40. Roger Hare
  41.